<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  /* <!-- 步骤二：准备一个具体大小的DOM容器------------> */
  #main {
    width: 800px;
    height: 800px;
    background-color: #fff;
  }
</style>
<body>
  <div id="main"></div>
  <script src="./lib/echarts.min.js"></script>
  
  <script>
    // <!-- 步骤三：初始化echarts实例对象--------------------->
    var myChart = echarts.init(document.getElementById('main'))
    option = {
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
    axisLabel: {
      textStyle: {
        color: 'red'
      }
    }
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      data: [120, 200, 150, 80, 70, 110, 130],
      type: 'bar',
      showBackground: true,
      color: {
        // color: 'rgba(180, 180, 180, 0.2)'
        x: 0,
        y: 0,
        x2: 0,
        y2: 1,
        colorStops: [
          {
            offset: 0,
            color: 'skyblue' // 0% 处的颜色
          },
          {
            offset: 1,
            color: 'pink' // 100% 处的颜色
          }
        ],
        global: false // 缺省为 false
      }
    },
    {
      data: [120, 200, 150, 80, 70, 110, 130],
      type: 'bar',
      showBackground: true,
      // backgroundStyle: {
      //   color: 'rgba(180, 180, 180, 0.2)'
      // }
      color: {
  type: 'radial',
  x: 0.5,
  y: 0.5,
  r: 0.5,
  colorStops: [{
      offset: 0, color: '#fff' // 0% 处的颜色
  }, {
      offset: 1, color: 'red' // 100% 处的颜色
  }],
  global: false // 缺省为 false
}
    }
  ]
};
      // <!-- 步骤五：将配置项设置给echarts实例对象 -->
      myChart.setOption(option)
  </script>
</body>
</html>